package com.neusoft.ch7.hw.test04;

public class SalesEmployee extends ColaEmployee {
	// 属性
	// 月销售额
	private double monthTotal;

	// 提成率
	private double saleRate;

	// 行为
	@Override
	public double getSalary(int month) {
		// 计算当前员工的月工资
		// 工资由月销售额和提成率决定
		double monthSalary = monthTotal * saleRate;
		// 加上生日金
		return monthSalary + super.getSalary(month);
	}

	public SalesEmployee(String empName, int empBirthdayMonth, double monthTotal, double saleRate) {
		super(empName, empBirthdayMonth);
		this.monthTotal = monthTotal;
		this.saleRate = saleRate;
	}

}
